home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Pane2 / c / SetVars < prev    next >
Text File  |  1995-08-23  |  2KB  |  71 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Pane2.SetVars.c
  12.     Author:  Copyright © 1995 Andrew Sellors.
  13.     Version: 1.04 (4th August 1995)
  14.     Purpose: Handles windows with panes.
  15. */
  16.  
  17. #include "DeskLib:Pane2.h"
  18. #include "Pane2Defs.h"
  19. #include "Desklib:Event.h"
  20. #include "DeskLib:Template.h"
  21. #include "Desklib:EventMsg.h"
  22. #include "Desklib:Error.h"
  23.  
  24. #include <stdlib.h>
  25.  
  26.  
  27. /******************************************************************************/
  28.  
  29. extern BOOL Pane2_SetVars(window_handle mainwindow, int panenumber,
  30.                            wimp_point *paneoffset, wimp_point *panesize)
  31. {
  32.  /*
  33.   * Sets paneoffset if 'paneoffset' is not NULL and panesize if 'panesize' is
  34.   * not NULL for the 'panenumber'th pane attatched to 'mainwindow'.
  35.   * TRUE is returned for success.
  36.   * After changing the variables, Pane2_OpenWindow must be used to make the
  37.   * windows on screen exhibit the changes.
  38.   */
  39.   main_listelement *mainelement;
  40.   pane_listelement *paneelement;
  41.  
  42.  /*
  43.   * find element for main window and return FALSE if mainwindow not present
  44.   */
  45.   mainelement = FindMainWindow(mainwindow);
  46.   if(mainelement == NULL)
  47.      return(FALSE); /* not found */
  48.  
  49.  /*
  50.   * find first pane window
  51.   */
  52.   paneelement = LinkList_FirstItem(&(mainelement->paneanchor));
  53.  
  54.   paneelement = FindPaneWindow(mainelement, panenumber);
  55.  
  56.   if(paneelement != NULL){
  57.  
  58.      if(paneoffset != NULL)
  59.          paneelement->paneoffset = *paneoffset;
  60.  
  61.      if(panesize != NULL)
  62.          paneelement->panesize = *panesize;
  63.  
  64.      return(TRUE);
  65.  
  66.   }
  67.   else
  68.     return(FALSE); /* not found */
  69.  
  70. }
  71.